package com.zhaojindong.ioc.component.autowiring;

import lombok.extern.log4j.Log4j;
import org.springframework.stereotype.Component;

@Log4j
@Component
public class Boss {

    private Car customCar;

    // 只有一个有参构造器时,@Autowired 可以省略;这里的位置包括方法上和参数上
//    public Boss(Car customCar) {
//        this.customCar = customCar;
//        log.info("boss 有参构造器");
//    }


    public void setCustomCar(Car customCar) {
        this.customCar = customCar;
    }

    @Override
    public String toString() {
        return "Boss{" +
                "car=" + customCar +
                '}';
    }
}
